<?	if ($c = stack('name')) {

	$_id_component	= $DATA['components'][$c]['id'];			//	list id value
	$_id_data		= D_MB_DATA;			//	meta id value
	$_id_meta		= D_MB_META;			//	meta id value

	$s = component_settings($c);

	// get current date
//	$DATA['today'] = parse_today();
	
	if (($dt = param('date')) && ($dt = parse_date($dt)) ) {		// AJAX reauest for the content
		$DATA['date'] = $dt;
		//return something here
		exit;
	}

	$_crit = "id_data=$_id_data AND id_parent=$_id_component AND assoc='{$CONTEXT[lang]}' AND name='title'";

	$DATA['components'][$c]['data'] = array();

	foreach ( datafetch_array('db_list', array('table' => tb('data'), 'where' => $_crit, 'select' => "*, DATE(date) as day", 'index' => 'day' )) as $date)
		$DATA['components'][$c]['data'][$date['day']] = array(
			'title' => h($date['value']), 
			'image' => checkImage(FP_UPLOAD_PATH."$s[path]/", "$date[assoc]-$date[day]")
		);

//debug($DATA['components'][$c]['data']);	
	unstack();
}

?>